import React from 'react'

export default class Share extends React.Component {
  render() {
    if (this.props.share.appMessageType &&
      this.props.share.appMessageType === 'URL') {
      return (
        <a className="media-box-card" href={ this.props.share.url }>
          <div className="media-box-card__hd">
            <h5 className="media-box-card__title">{ this.props.share.title }</h5>
          </div>
          <div className="media-box-card__bd">
            <div className="media-box-card__desc">{ this.props.share.description }</div>
            <div className="media-box-card__thumb">
              <img src={ this.props.share.thumbUrl } />
            </div>
          </div>
          {
            this.props.share.appName &&
            <div className="media-box-card__ft">{ this.props.share.appName }</div>
          }
        </a>
      )
    }
    return null
  }
}